package com.copm.demonstrationsystem.dao.introductionfeatures;

import com.copm.demonstrationsystem.pojo.commons.Image;
import com.copm.demonstrationsystem.pojo.introductionfeatures.IntroductionImage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface IntroductionImageDao extends JpaRepository<IntroductionImage, Long> {

    List<IntroductionImage> findByImageKind(Long kind);

    IntroductionImage findByImage_Id(Long id);




    /**
     * 1、查询企业文化的背景图片
     * 2、图片种类为 2
     * 3、查询结果是一个list，所以要进行判断
     * @return
     */
//    @Query(value = "SELECT * FROM introduction_image WHERE image_kind = 2", nativeQuery = true)
//    List<IntroductionImage> getCompanyCultureBgImage();

//    @Query(value = "select introduction_image FROM introduction_image WHERE introduction_image.image.id=:id", nativeQuery = true)
//    IntroductionImage getCompanyIntroductionImageByImageId(Long id);
}
